package com.kai.steering.data.service.entity.po;

import com.baomidou.mybatisplus.annotation.IdType;

import java.util.Date;

import com.baomidou.mybatisplus.annotation.TableId;

import java.io.Serializable;

import com.baomidou.mybatisplus.annotation.TableName;
import com.kai.steering.data.service.entity.domainObject.QuestionDetailsDO;
import lombok.*;

import java.io.Serializable;

/**
 * <pre>
 * 题目详情
 * </pre>
 *
 * @author kai
 * @since 2022-02-23
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
@Builder
@ToString
@EqualsAndHashCode(callSuper = false)
@TableName(value = "question_details")

public class QuestionDetails implements Serializable {

    private static final long serialVersionUID = 1L;

    /**
     * 题目详情id
     */
    @TableId(value = "question_details_id", type = IdType.ID_WORKER)

    private String questionDetailsId;


    /**
     * 题目id
     */

    private String questionId;


    /**
     * 内容
     */

    private String content;


    /**
     * 创建时间
     */

    private Date creationDatetime;


    /**
     * 创建人管理员id或者用户id
     */

    private String founder;


    /**
     * 存在0删除1
     */

    private Integer usable;


    /**
     * 删除日期
     */

    private Date deleteDatetime;


    public QuestionDetails(QuestionDetailsDO questionDetailsDO) {
        convertQuestion(questionDetailsDO);
    }
    public QuestionDetails  convertQuestion(QuestionDetailsDO questionDetailsDO) {
        this.questionDetailsId=questionDetailsDO.getQuestionDetailsId();
        this.questionId=questionDetailsDO.getQuestionId();
        this.content=questionDetailsDO.getContent();
        this.creationDatetime=questionDetailsDO.getCreationDatetime();
        this.founder=questionDetailsDO.getFounder();
        this.usable=questionDetailsDO.getUsable();
        this.deleteDatetime=questionDetailsDO.getDeleteDatetime();
        return this;
    }
}
